<template>
	<view>
		<view class="backstage_logo">
			<image src="@/static/logo.png" mode="aspectFit"></image>
		</view>
		<view class="backstage_put">
			<text>是否允许账号《wangjia01-王佳》登录?</text>
		</view>
		<view class="backstage_login">确认登录</view>
	</view>
</template>

<script>
	var util = require('@/util/request5.js');
	export default {
		data() {
			return {
				only_no: null,
				code: null,
				type: null
			}
		},
		onLoad(e) {
			this.only_no = e.only_no
			this.type = e.type
			this.code = e.code
			this.login()
			this.show()
		},
		methods: {
			show() {},
			back() {
				let UrlEncode = encodeURIComponent(util.WEB_URL + '/pages/version1/backstage/backstage')
				location.href =
					`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf54275fed243d401&redirect_uri=` +
					UrlEncode + `&only_no=` + this.only_no +
					`&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect`
			},
			login() {
				uni.request({
					url: util.API_URL + '/admin/Index/getWxInfo',
					data: {
						only_no: this.only_no,
						type: this.type,
						code: this.code,
					},
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					method: "POST",
					success: (res) => {},
					fail(err) {}
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.backstage_logo {
		display: flex;
		justify-content: center;

		image {
			width: 80%;
			height: 300rpx;
			// margin-top: 100rpx;
			margin-bottom: 60rpx;
		}
	}

	.backstage_put {
		border-bottom: #373b54 1px solid;
		padding: 30rpx;
		box-sizing: border-box;
		text-align: center;
		width: 90%;
		margin: auto;

		text {
			font-size: 28rpx;
			color: #333;
		}
	}

	.backstage_login {
		width: 60%;
		margin: 160rpx auto 0 auto;
		background-color: #2e3e55;
		color: #fff;
		font-size: 28rpx;
		text-align: center;
		padding: 20rpx 0;
		border-radius: 15rpx;
		transition: all 0.4s;
	}

	.backstage_login:active {
		opacity: 0.8;
	}
</style>